package ac2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
 

public class HttpRequest {
    public static void send(String requestUrl) {
        try {
        	
        	System.out.println(requestUrl);
        	
            URL url = new URL(requestUrl.toString());
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String inputLine;
            /*
            //
            // TBD - log response to a file
            //
            System.out.println("-----RESPONSE START-----");
            while ((inputLine = in.readLine()) != null) {
                System.out.println(inputLine);
            }
            in.close();
            System.out.println("-----RESPONSE END-----");
            */
        } catch (IOException e) {
            //e.printStackTrace();
        	System.out.println("\t" + e.getMessage());
        }
    }
}
